package com.example.jett.mvvm_20180612_02;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    ListView list;
    List<User> data=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        list= (ListView) findViewById(R.id.listView);
        data.add(new User("http://img3.imgtn.bdimg.com/it/u=2862957520,3212353041&fm=27&gp=0.jpg","林志玲1","1222222"));
        data.add(new User("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1528871187294&di=fe832833bd94aa50924409c3a0dde2b5&imgtype=0&src=http%3A%2F%2Fa3.topitme.com%2F1%2F21%2F79%2F1128833621e7779211o.jpg","林志玲12","1222222"));
        data.add(new User("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1528871187294&di=ed61e1b0e4651e7f256c1dd9a89543bc&imgtype=0&src=http%3A%2F%2Ffd.topitme.com%2Fd%2Fa8%2F1d%2F11315383988791da8do.jpg","林志玲13","1222222"));
        data.add(new User("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1528871187294&di=0479e6c4bd0516ca2d1a6ea272be6a6e&imgtype=0&src=http%3A%2F%2Ff9.topitme.com%2F9%2F37%2F30%2F11224703137bb30379o.jpg","林志玲14","1222222"));
        data.add(new User("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1528871187293&di=6c3dea91f9c040d8619e1364e9fe4b29&imgtype=0&src=http%3A%2F%2Fimg.taopic.com%2Fuploads%2Fallimg%2F140702%2F240404-140F20QG490.jpg","4","4"));
        list.setAdapter(new CommAdapter<User>(this,getLayoutInflater(),R.layout.item, com.example.jett.mvvm_20180612_02.BR.user,data));
    }
}










